home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / Misc / GMS / GMSDev / Source / C / Screens / HiResScreen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-12-16  |  1.2 KB  |  49 lines

  1. /* Dice: dcc -l0 -mD dpk.o HiResScreen.c -o HiResScreen
  2. **
  3. ** Opens a screen of 640x256 pixels in HIRES LACED mode.  You can even try
  4. ** SuperHiRes (SHIRES) if you change the appropriate flag in the Screen object.
  5. */
  6.  
  7. #include <proto/dpkernel.h>
  8.  
  9. BYTE *ProgName      = "High-Resolution Screen";
  10. BYTE *ProgAuthor    = "Paul Manias";
  11. BYTE *ProgDate      = "9 December 1997";
  12. BYTE *ProgCopyright = "DreamWorld Productions (c) 1996-1997.  Freely distributable.";
  13. BYTE *ProgShort     = "High resolution screen display.";
  14.  
  15. void main(void)
  16. {
  17.   struct GScreen  *Screen;
  18.   struct Picture  *pic;
  19.   struct JoyData  *joydata;
  20.   struct FileName PicFile = { ID_FILENAME, "GMS:demos/data/PIC.Pic640x256" };
  21.  
  22.   if (pic = Load(&PicFile, ID_PICTURE)) {
  23.      Screen = Get(ID_SCREEN);
  24.      CopyStructure(pic,Screen);
  25.      Screen->MemPtr1 = pic->Bitmap->Data;
  26.      Screen->Width   = 640;
  27.      Screen->Height  = 256;
  28.      Screen->ScrMode = HIRES|LACED;
  29.  
  30.      if (joydata = Init(Get(ID_JOYDATA),NULL)) {
  31.  
  32.         if (Init(Screen,NULL)) {
  33.  
  34.            Display(Screen);
  35.  
  36.            while (!(joydata->Buttons & JD_LMB)) {
  37.              WaitAVBL();
  38.              Query(joydata);
  39.            }
  40.  
  41.         Free(Screen);
  42.         }
  43.      Free(joydata);
  44.      }
  45.   Free(pic);
  46.   }
  47. }
  48.  
  49.